import { Table2Icon } from 'lucide-react';
import { useEditorStore } from '@/store/useEditorZustand';
import { Button } from 'antd';
import cx from 'classnames';

export default function InsertTableButton() {
  const { editor } = useEditorStore();
  const hanlerClick = () => {
    editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run();
  };

  return (
    <Button icon={<Table2Icon className={cx('size-4')} />} type="text" onClick={hanlerClick} />
  );
}
